<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body class="sss">
<!--sdfs-->
<ul>
    <li><a href="images/1.jpg" onclick="changePicture(this); return false">图片1</a></li>
    <li><a href="images/2.jpg" onclick="changePicture(this); return false">图片2</a></li>

    <li><a href="images/3.jpg" onclick="changePicture(this); return false">图片3</a></li>
</ul>
<img id="picturePlaceHolder" >
<p>
    it is a picture;
</p>

<script>
    function changePicture(node)
    {
        console.log(node);
        var picture = document.getElementById('picturePlaceHolder');
        picture.src = node.href;
        picture.title = node.text;
        document.getElementsByTagName('p')[0].nodeValue = node.text;
        document.getElementsByTagName('p')[0].textContent = node.text;
        document.getElementsByTagName('p')[0].childNodes[0].nodeValue = node.text;
    }

    window.onload = function () {
        console.log(document.getElementsByTagName('body')[0].childNodes.length);
        document.getElementsByTagName('body')[0].childNodes.forEach((node)=>{
            console.log(node.nodeType);
        })
    }

</script>

</body>
</html>